#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
#endregion Using

namespace PhotoGallery.Core.Business
{
    public class FileRecord : Business.BusinessBase<FileRecord, int>
    {
        #region Fields and Properties

        private String extention = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Extention
        {
            get { return extention; }
            set
            {
                if (value != extention)
                {
                    MarkChanged("Extention");
                    extention = value;
                }
            }
        }

        private String name = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Name
        {
            get { return name; }
            set
            {
                if (value != name)
                {
                    MarkChanged("Name");
                    name = value;
                }
            }
        }

        private String path = String.Empty;
        /// <summary>
        /// 
        /// </summary>
        public String Path
        {
            get { return path; }
            set
            {
                if (value != path)
                {
                    MarkChanged("Path");
                    path = value;
                }
            }
        }

        #endregion Fields and Properties

        #region Constructors

        public FileRecord()
        {
        }

        #endregion Constructors

        #region Base overrides

        protected override void ValidationRules()
        {
        }

        protected override FileRecord DataSelect(int id)
        {
            return Services.DALService.FileRecordService.Select(id);
        }

        protected override void DataUpdate()
        {
            Services.DALService.FileRecordService.Update(this);
        }

        protected override void DataInsert()
        {
            Services.DALService.FileRecordService.Insert(this);
        }

        protected override void DataDelete()
        {
            Services.DALService.FileRecordService.Delete(this);
        }

        #endregion Base overrides



        public static FileRecord Find(string result)
        {
            return Services.DALService.FileRecordService.Find(result);
        }
    }
}
